// 文件位置: src/main/java/com/pharmacy/LogManage/entity/OperationLog.java
package com.pharmacy.LogManage.entity;

import com.pharmacy.UserManage.entity.User;

import java.util.Date;

public class OperationLog {
    private Integer id;
    private Integer userId;
    private String operationType;
    private String targetType;
    private Integer targetId;
    private String description;
    private Date operationTime;
    private User user; // 关联用户信息

    // 构造方法
    public OperationLog() {}

    public OperationLog(Integer userId, String operationType, String targetType,
                        Integer targetId, String description) {
        this.userId = userId;
        this.operationType = operationType;
        this.targetType = targetType;
        this.targetId = targetId;
        this.description = description;
        this.operationTime = new Date();
    }

    // Getter和Setter方法
    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }

    public Integer getUserId() { return userId; }
    public void setUserId(Integer userId) { this.userId = userId; }

    public String getOperationType() { return operationType; }
    public void setOperationType(String operationType) { this.operationType = operationType; }

    public String getTargetType() { return targetType; }
    public void setTargetType(String targetType) { this.targetType = targetType; }

    public Integer getTargetId() { return targetId; }
    public void setTargetId(Integer targetId) { this.targetId = targetId; }

    public String getDescription() { return description; }
    public void setDescription(String description) { this.description = description; }

    public Date getOperationTime() { return operationTime; }
    public void setOperationTime(Date operationTime) { this.operationTime = operationTime; }

    public User getUser() { return user; }
    public void setUser(User user) { this.user = user; }
}